<template>
  <div style="height:100%">
    <div style="height:100%">
      <div class="flexBetween">
        <div style="color:#fff;font-size:1.6rem;margin-bottom:5%">预警动态</div>
      <!-- <div style="color:#00F6FF;font-size:1.3rem;margin-bottom:5%">更多</div> -->
      </div>
      
      <div style="margin-left:2rem;height:100%">
        <vue-seamless-scroll v-if="List.length>6" :data="List" class="seamless-warp" :class-option="classOption">
          <ul>
            <li v-for="(item, index) in List" :key="index">
                <span>{{item.date}}</span>
                <!-- <span>{{item.tenderCode}}</span> -->
                <span>{{item.tenderCode}}</span>
                <span>{{item.fullName}}</span>
                <span>{{item.news}}</span>
            </li>
          </ul>
        </vue-seamless-scroll>
   
          <ul v-else>
            <li v-for="(item, index) in List" :key="index">
                <span>{{item.date}}</span>
                <!-- <span>{{item.tenderCode}}</span> -->
                <span>{{item.tenderCode}}</span>
                <span>{{item.fullName}}</span>
                <span>{{item.news}}</span>
            </li>
          </ul>
     
      </div>
    </div>
  </div>
</template>

<script>
import vueSeamlessScroll from 'vue-seamless-scroll'
import { getWarningNews } from '@/api/realNameStatistics'

export default {
  data() {
    return {
      List: []
    }
  },
  components: {
    //组件
    vueSeamlessScroll
  },
  computed: {
    classOption() {
      return {
        step: 0.2, // 数值越大速度滚动越快
        // limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
        //  openRoll:false,
        // fheight:300,
      }
      
    }
  },
  mounted () {
    this.getData()
  },
  methods: {
    getData(){
      getWarningNews({ projectId: this.$store.state.userInfo.projectId }).then(res=>{
        this.List=res.data.data
     })
    }
     
  }
}
</script>

<style scoped>
ul,
li {
  margin: 0;
  padding: 0;
  list-style: none;
}
li {
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 0.3rem;
}
li:hover {
  color: #fff;
  background: #143F53;
  transition: 0.5s all;
}
.seamless-warp {
  width: 100%;
  height: 80%;
  margin: 0;
  overflow: hidden;
  font-size: 1.4rem;
  font-family: 'Microsoft YaHei';
  font-weight: 400;
  color: #5cffff;
}
span{
    margin-right: 1rem;
}
</style>